package com.adams.custom.page.core;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

import com.adams.access.db.bean.DicBusinessDealFlow;

/**
 * 
 * File Name : BusinessDealFlowContext.java
 * 
 * @Description : 业务处理流上下文对象
 */
public class BusinessDealFlowContext
{

	/**
	 * Description : 表定义编码 Author : 904370
	 */
	private String tablecode;

	/**
	 * Description : 操作类型 Author : 904370
	 */
	private String actionType;

	/**
	 * Description : 业务处理流列表 Author : 904370
	 */
	private List<DicBusinessDealFlow> dicBusinessDealFlows;

	/**
	 * Description : 处理位置 Author : 904370
	 */
	private int dealPos = 0;

	/**
	 * Description : 界面传入参数 Author : 904370
	 */
	@SuppressWarnings("unchecked")
	private List<Map> inputMaps = new ArrayList<Map>();

	/**
	 * Description : 业务逻辑过程参数 Author : 904370
	 */
	@SuppressWarnings("unchecked")
	private Hashtable attribute = new Hashtable();

	@SuppressWarnings("unchecked")
	public BusinessDealFlowContext(String tablecode, String actionType,
			List<Map> inputMaps)
	{
		super();
		this.tablecode = tablecode;
		this.actionType = actionType;
		this.inputMaps = inputMaps;
	}

	public String getTablecode()
	{
		return tablecode;
	}

	public void setTablecode(String tablecode)
	{
		this.tablecode = tablecode;
	}

	public String getActionType()
	{
		return actionType;
	}

	public void setActionType(String actionType)
	{
		this.actionType = actionType;
	}

	public List<DicBusinessDealFlow> getDicBusinessDealFlows()
	{
		return dicBusinessDealFlows;
	}

	public void setDicBusinessDealFlows(
			List<DicBusinessDealFlow> dicBusinessDealFlows)
	{
		this.dicBusinessDealFlows = dicBusinessDealFlows;
	}

	public int getDealPos()
	{
		return dealPos;
	}

	@SuppressWarnings("unchecked")
	public List<Map> getInputMaps()
	{
		return inputMaps;
	}

	@SuppressWarnings("unchecked")
	public void setInputMaps(List<Map> inputMaps)
	{
		this.inputMaps = inputMaps;
	}

	/**
	 * Description : 增加业务逻辑过程参数
	 * 
	 * @param name
	 * @param o
	 * 
	 */
	@SuppressWarnings("unchecked")
	public void setAttribute(String name, Object o)
	{
		this.attribute.put(name, o);
	}

	/**
	 * Description :根据关键字，删除业务逻辑过程参数值
	 * 
	 * @param name
	 * 
	 */
	public void removeAttribute(String name)
	{
		this.attribute.remove(name);
	}

	/**
	 * Description :根据关键字，获取业务逻辑过程参数值
	 * 
	 * @param name
	 * @return
	 * 
	 */
	public Object getAttribute(String name)
	{
		return this.attribute.get(name);
	}

	/**
	 * Description :获取业务逻辑过程参数集合
	 * 
	 * @return
	 * 
	 */
	@SuppressWarnings("unchecked")
	public Enumeration getAttributeNames()
	{
		return this.attribute.keys();
	}

	public void next()
	{
		dealPos++;
	}
}
